<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户登录</title>
<script type="text/javascript" src="${base}/res/comm/js/jquery/jquery.js"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	overflow:hidden;
}
.STYLE3 {color: #528311; font-size: 12px; }
.STYLE4 {
	color: #42870a;
	font-size: 12px;
}
-->
</style>
<script type="text/javascript">
  var loginURL = '${base}/admin/submit.jhtml';
  function loginval(obj){
    obj.attr('disabled',true);
  	var t=/^[^\s]+$/;
  	var username = $('#username');
	var password = $('#password');
	var j_captcha= $('#j_captcha');
  	if(!t.test(username.val())){
  		alert('用户名不能为空');
  		username.select();
  	    obj.attr('disabled',false);
  		return false;
  	}
  	if(!t.test(password.val())){
  		alert('密码不能为空');
  		password.select();
  	    obj.attr('disabled',false);
  		return false;
  	}
  	var jc=/^\d{4}$/;
  	if(!jc.test(j_captcha.val())){
  		alert('请输入验证码');
  		j_captcha.select();
  		obj.attr('disabled',false);
  		return false;
  	}
  	$.ajax({
		type: "post",
		dataType: 'json',
		data :{
			'username':username.val(),
			'password':password.val(),
			'j_captcha':j_captcha.val()
		},
		url:loginURL,
		success:function(data){
			if (data.status == 'success') {
				window.location.href = '${base}/admin/main.jhtml';
			} else {
				window.alert(data.message);	
				$('#captcha_img').attr('src','${base}/captcha.vsl?t='+new Date().getTime());
				obj.attr('disabled',false);
				j_captcha.val('');
			}
		},
		error: function(){
			window.alert('系统异常，请稍后再试');
			obj.attr('disabled',false);
			$('#captcha_img').attr('src','${base}/captcha.vsl?t='+new Date().getTime());
			j_captcha.val('');
		}	
	});
  }
  
  </script>
</head>

<body onload="javascript:$('#username').focus();">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#e5f6cf">&nbsp;</td>
  </tr>
  <tr>
    <td height="608" background="${base}/res/admin/images/login_03.gif"><table width="862" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="266" background="${base}/res/admin/images/login_04.gif">&nbsp;</td>
      </tr>
      <tr>
        <td height="95">
        
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="424" height="95" background="${base}/res/admin/images/login_06.gif">&nbsp;</td>
            <td width="183" background="${base}/res/admin/images/login_07.gif">
            
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="21%"><div align="center"><span class="STYLE3">用户</span></div></td>
                <td width="79%">
                <input type="text" id=username class=textbox1 size=11 name=username value="admin" style="height:18px; width:130px; border:solid 1px #cadcb2; font-size:12px; color:#81b432;">
                </td>
              </tr>
              <tr>
                <td><div align="center"><span class="STYLE3">密码</span></div></td>
                <td>
                <input id="password" class="textbox1" size=11 type="password" name="password" value="123456" style="height:18px; width:130px; border:solid 1px #cadcb2; font-size:12px; color:#81b432;"/>
                </td>
              </tr>
              <tr>
                <td><div align="center"><span class="STYLE3">验证码</span></div></td>
                <td>
                <input type="text" id="j_captcha" class="textbox1" maxlength="4" value="0000" name="j_captcha" style="height:18px; width:60px; border:solid 1px #cadcb2; font-size:12px; color:#81b432;" onkeyup="if(event.keyCode==13) return loginval($('#logimg'));">
                <img id="captcha_img" class=textbox1 src="/captcha.vsl" title="看不清?点击换一张" onclick="javascript:this.src='${base}/captcha.vsl?t='+new Date().getTime();" style="height:18px; width:67px; border:solid 1px #cadcb2; font-size:12px; color:#81b432;"/>
                </td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>
                <input id="logimg" onclick="return loginval($('#logimg'));" width="81" height="22" border="0" type="button" value="登陆"/>
                </td>
              </tr>
            </table>
            
            </td>
            <td width="255" background="${base}/res/admin/images/login_08.gif">&nbsp;</td>
          </tr>
        </table>
        
        </td>
      </tr>
      <tr>
        <td height="247" valign="top" background="${base}/res/admin/images/login_09.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="22%" height="30">&nbsp;</td>
            <td width="56%">&nbsp;</td>
            <td width="22%">&nbsp;</td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="44%" height="20">&nbsp;</td>
                <td width="56%" class="STYLE4">版本 V1.0 </td>
              </tr>
            </table></td>
            <td>&nbsp;</td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td bgcolor="#a2d962">&nbsp;</td>
  </tr>
</table>

<map name="Map"><area shape="rect" coords="3,3,36,19" href="#"><area shape="rect" coords="40,3,78,18" href="#"></map></body>
</html>